#!/bin/sh

set -eu

main() {
  echo "snippet: open"

  git_prompt

  echo "snippet: close"
}

git_prompt() {
  _branch=$(git branch --show-current)

  if [ -z "$_branch" ]; then
    echo "git:$(git rev-parse --short HEAD)"
  else
    echo "$_branch"
  fi
}

main
